<!-- inc:header -->
<div class="notice"><div class="p">
	<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td width="130px"><span class="lead">&nbsp;&raquo; 风格管理</span></td>
		<td align="right"><a href="{:site_url('tpl,set')}" class="button">添加新风格</a></td>
	</tr>
	</table>
</div></div>

<div class="main">
<table width="100%" style="layout:fixed;" cellpadding="0" cellspacing="0">
<tr>
	<td class="t_sub" width="30px">&nbsp;</td>
	<td class="t_sub" width="50px">ID</td>
	<td class="t_sub" width="35px">状态</td>
	<td class="t_sub">名称</td>
    <td class="t_sub" width="90px">扩展</td>
	<td class="t_sub" width="40px">排序</td>
	<td class="t_sub" width="65px">操作</td>
</tr>
<!-- $rslist AS $key=>$value -->
<tr class="tr_out" onMouseOver="over_tr(this)" onMouseOut="out_tr(this)">
	<td align='center' class="tc_left"><input type="radio" name="set_default" onclick="set_default('{:$value[id]}')"{if($value[ifdefault])} checked{end}></td>
	<td align='center' class="tc_right">{:$value[id]}</td>
	<td align="center" class="tc_right" id="status_{:$value['id']}"><a href="javascript:status({:$value[id]},{:intval($value['status'])});void(0);" class="status{:intval($value['status'])}"></a></td>
	<td align='left' class="tc_right">&nbsp;{:$value[title]} <!-- if($value[ifsystem]) --><span class="red">系统模板</span><!-- end --></td>
	<td align='center' class="tc_right">{:$value[ext]}</td>
	<td align="center" class="tc_right">{:$value[taxis] ? $value[taxis] : '-'}</td>
	<td align="center" class="tc_right">
		<a href="{:site_url('tpl,set')}id={:$value[id]}" class="btn edit" title="编辑"></a>
        <a href="{:site_url('tpl,list')}id={:$value[id]}" class="btn key" title="模板文件"></a>
		<a href="javascript:del({:$value['id']});void(0);" class="btn del" title="删除"></a>
	</td>
</tr>
<!-- end -->
</table>
</div>
<script type="text/javascript">
function del(id)
{
	if(!id)
	{
		alert("操作非法");
		return false;
	}
	var q = confirm("确定要删除此信息吗？删除后是不能恢复的");
	if(q != 0)
	{
		var url = base_url + base_func + "=ajax_del&id="+id;
		var msg = get_ajax(url);
		if(!msg) msg = "error: 操作非法";
		if(msg == "ok")
		{
			direct(window.location.href);
		}
		else
		{
			alert(msg);
			return false;
		}
	}
}

//更改权限状态
function status(id,t)
{
	if(!id)
	{
		alert("操作非法");
		return false;
	}
	var url = base_url + base_func + "=ajax_status&id="+id;
	var msg = get_ajax(url);
	if(msg == "ok")
	{
		var n_t = t == 1 ? 0 : 1;
		$("#status_"+id+" > a").attr("class","status"+n_t);
		$("#status_"+id+" > a").attr("href","javascript:status("+id+","+n_t+");void(0)");
		return true;
	}
	else
	{
		if(!msg) msg = "error: 操作非法";
		alert(msg);
		return false;
	}
}
function set_default(id)
{
	if(!id)
	{
		alert("操作非法");
		return false;
	}
	var url = base_url + base_func + "=ajax_default&id="+id;
	get_ajax(url);
	return true;
}
</script>
<!-- inc:footer -->